package org.linlinjava.litemall.web.controller;

import io.swagger.annotations.Api;
import org.linlinjava.litemall.core.util.ResponseUtil.Response;
import org.linlinjava.litemall.web.annotation.LogAnno;
import org.linlinjava.litemall.web.annotation.LoginShop;
import org.linlinjava.litemall.web.annotation.LoginUser;
import org.linlinjava.litemall.web.service.WebTodayDataService;
import org.linlinjava.litemall.web.vo.TodayVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 今天web数据控制器
 *
 * @author yliyun
 * @date 2022/09/14
 */
@Api(value="今日数据controller",tags={"今日数据操作接口"})
@RestController
@RequestMapping("/web/today")
public class WebTodayDataController {

    /**
     * 今天网络数据服务
     */
    @Autowired
    private WebTodayDataService webTodayDataService;

    /**
     * 今天查询数据
     *
     * @param today  今天
     * @param userId 用户id
     * @return {@link Response}<{@link TodayVO}>
     */
    @GetMapping("data")
    @LogAnno
    public Response<TodayVO> queryTodayData(boolean today, @LoginUser Integer userId, @LoginShop Integer shopId){
        return webTodayDataService.queryTodayData(today,userId,shopId);
    }

}
